package com.senlingspace.system.service.impl;

import java.util.List;
import com.senlingspace.common.utils.DateUtils;
import com.senlingspace.common.utils.SecurityUtils;
import com.senlingspace.system.domain.dto.EquipmentLogDto;
import com.senlingspace.system.domain.vo.SlkjEquipmentLogVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.senlingspace.system.mapper.SlkjEquipmentLogMapper;
import com.senlingspace.system.domain.SlkjEquipmentLog;
import com.senlingspace.system.service.ISlkjEquipmentLogService;

/**
 * 设备变更Service业务层处理
 * 
 * @author SenlingSpace
 * @date 2024-10-10
 */
@Service
public class SlkjEquipmentLogServiceImpl implements ISlkjEquipmentLogService 
{
    @Autowired
    private SlkjEquipmentLogMapper slkjEquipmentLogMapper;

    /**
     * 查询设备变更
     * 
     * @param id 设备变更主键
     * @return 设备变更
     */
    @Override
    public SlkjEquipmentLog selectSlkjEquipmentLogById(Long id)
    {
        return slkjEquipmentLogMapper.selectSlkjEquipmentLogById(id);
    }

    /**
     * 查询设备变更列表
     * 
     * @param slkjEquipmentLog 设备变更
     * @return 设备变更
     */
    @Override
    public List<SlkjEquipmentLog> selectSlkjEquipmentLogList(SlkjEquipmentLog slkjEquipmentLog)
    {
        return slkjEquipmentLogMapper.selectSlkjEquipmentLogList(slkjEquipmentLog);
    }

    /**
     * 新增设备变更
     * 
     * @param slkjEquipmentLog 设备变更
     * @return 结果
     */
    @Override
    public int insertSlkjEquipmentLog(SlkjEquipmentLog slkjEquipmentLog)
    {
        slkjEquipmentLog.setCreateBy(SecurityUtils.getUsername());
        slkjEquipmentLog.setCreateTime(DateUtils.getNowDate());
        return slkjEquipmentLogMapper.insertSlkjEquipmentLog(slkjEquipmentLog);
    }

    /**
     * 修改设备变更
     * 
     * @param slkjEquipmentLog 设备变更
     * @return 结果
     */
    @Override
    public int updateSlkjEquipmentLog(SlkjEquipmentLog slkjEquipmentLog)
    {
        slkjEquipmentLog.setUpdateTime(DateUtils.getNowDate());
        return slkjEquipmentLogMapper.updateSlkjEquipmentLog(slkjEquipmentLog);
    }

    /**
     * 批量删除设备变更
     * 
     * @param ids 需要删除的设备变更主键
     * @return 结果
     */
    @Override
    public int deleteSlkjEquipmentLogByIds(Long[] ids)
    {
        return slkjEquipmentLogMapper.deleteSlkjEquipmentLogByIds(ids);
    }

    /**
     * 删除设备变更信息
     * 
     * @param id 设备变更主键
     * @return 结果
     */
    @Override
    public int deleteSlkjEquipmentLogById(Long id)
    {
        return slkjEquipmentLogMapper.deleteSlkjEquipmentLogById(id);
    }

    @Override
    public List<SlkjEquipmentLogVo> selectEquipmentUpdateLogList(EquipmentLogDto equipmentLogDto) {
        return slkjEquipmentLogMapper.selectEquipmentUpdateLogList(equipmentLogDto);
    }
}
